Optimal. Leaf size=74 \[ \frac {(a+b)^2 \log (1-\cos (c+d x))}{2 d}-\frac {2 a b \log (\cos (c+d x))}{d}-\frac {(a-b)^2 \log (1+\cos (c+d x))}{2 d}+\frac {b^2 \sec (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3957, 2916, 12,
1816} \begin {gather*} -\frac {(a-b)^2 \log (\cos (c+d x)+1)}{2 d}+\frac {(a+b)^2 \log (1-\cos (c+d x))}{2 d}-\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \sec (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 1816
Rule 2916
Rule 3957
Rubi steps
\begin {align*} \int \csc (c+d x) (a+b \sec (c+d x))^2 \, dx &=\int (-b-a \cos (c+d x))^2 \csc (c+d x) \sec ^2(c+d x) \, dx\\ &=\frac {a \text {Subst}\left (\int \frac {a^2 (-b+x)^2}{x^2 \left (a^2-x^2\right )} \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=\frac {a^3 \text {Subst}\left (\int \frac {(-b+x)^2}{x^2 \left (a^2-x^2\right )} \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=\frac {a^3 \text {Subst}\left (\int \left (\frac {(a-b)^2}{2 a^3 (a-x)}+\frac {b^2}{a^2 x^2}-\frac {2 b}{a^2 x}+\frac {(a+b)^2}{2 a^3 (a+x)}\right ) \, dx,x,-a \cos (c+d x)\right )}{d}\\ &=\frac {(a+b)^2 \log (1-\cos (c+d x))}{2 d}-\frac {2 a b \log (\cos (c+d x))}{d}-\frac {(a-b)^2 \log (1+\cos (c+d x))}{2 d}+\frac {b^2 \sec (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.10, size = 91, normalized size = 1.23 \begin {gather*} \frac {-(a-b)^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-2 a b \log (\cos (c+d x))+a^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+2 a b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+b^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+b^2 \sec (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 66, normalized size = 0.89
method | result | size |
derivativedivides | \(\frac {b^{2} \left (\frac {1}{\cos \left (d x +c \right )}+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+2 b a \ln \left (\tan \left (d x +c \right )\right )+a^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}\) | \(66\) |
default | \(\frac {b^{2} \left (\frac {1}{\cos \left (d x +c \right )}+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+2 b a \ln \left (\tan \left (d x +c \right )\right )+a^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}\) | \(66\) |
norman | \(-\frac {2 b^{2}}{d \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (a^{2}+2 b a +b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 b a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}-\frac {2 b a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) | \(88\) |
risch | \(\frac {2 b^{2} {\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b a}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b^{2}}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b a}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b^{2}}{d}-\frac {2 b a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(167\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 73, normalized size = 0.99 \begin {gather*} -\frac {4 \, a b \log \left (\cos \left (d x + c\right )\right ) + {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\cos \left (d x + c\right ) + 1\right ) - {\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (\cos \left (d x + c\right ) - 1\right ) - \frac {2 \, b^{2}}{\cos \left (d x + c\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.25, size = 97, normalized size = 1.31 \begin {gather*} -\frac {4 \, a b \cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right ) + {\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (d x + c\right ) \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (a^{2} + 2 \, a b + b^{2}\right )} \cos \left (d x + c\right ) \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 2 \, b^{2}}{2 \, d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \csc {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.49, size = 124, normalized size = 1.68 \begin {gather*} -\frac {4 \, a b \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) - {\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) - \frac {4 \, {\left (a b + b^{2} + \frac {a b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )}}{\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.97, size = 62, normalized size = 0.84 \begin {gather*} \frac {\frac {\ln \left (\cos \left (c+d\,x\right )-1\right )\,{\left (a+b\right )}^2}{2}-\frac {\ln \left (\cos \left (c+d\,x\right )+1\right )\,{\left (a-b\right )}^2}{2}+\frac {b^2}{\cos \left (c+d\,x\right )}-2\,a\,b\,\ln \left (\cos \left (c+d\,x\right )\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________